<template>
  <div class="com-a">
    <h1>A组件</h1>
    <p>{{msg}}</p>
  </div>
</template>

<script>
import eventBus from '@/eventBus'
export default {
  name: 'com-a',
  data () {
    return {
      msg: ''
    }
  },
  created () {
    // 接收数据
    eventBus.$on('b2a', (data) => {
      this.msg = data
    })
  }
}
</script>
